<%-- 
    Document   : Studenti_Segreteria
    Created on : 7-mag-2012, 16.51.20
    Author     : fabrizio
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="Utils.Studente" %>

<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Studenti</title>

  <link rel="stylesheet" type="text/css" href="css/bootstrap.css"> <!-- Chiamata al css contenente la grafica -->
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
  <link rel="stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.8.19.custom.css" >
  <script type="text/javascript" src="js/jquery-ui-1.8.19.custom.min.js" ></script>
  
<style type="text/css">
        #selectable .ui-selecting { background: #FFFFFF; }
	#selectable .ui-selected { background: #99CBFF; color: black; border: #34FF12; }
</style>

<script>
            $(document).ready(function (){
               $('#tabs li:eq(0) a').tab('show');
               var x = $(document).height();
               $('#Bottom_bar').css("top", (x+118)+"px");
               $('#Menu_background').css("height" , x+"px");
            });

</script>


<script type="text/javascript">
	$(function() {
		$("#selectable").selectable(
                { filter : 'tr',                 
                  stop: function() 
                    {
                        
                        str = ($(".ui-selected",this).attr("id"));
                            if(str.match("Row-0"))
                                    $(".ui-selected",this).removeClass("ui-selected");
                            else
                                {
                                document.location.href = "Studenti_Segreteria?ID="+(get_selected_index()-1);
                                }
			$(".ui-selected",this).each(function() {
                               $(this).siblings().removeClass("ui-selected");         
		     })}})
	});
        
       function get_selected_index(){
         var elim = document.getElementById(str);
         var x = elim.rowIndex;
         return x;
       }
</script> 
  
</head>

<body>
    
    <jsp:useBean id = "result" scope = "request" class="java.util.List<Studente>" ></jsp:useBean>
    <jsp:useBean id = "studente" scope = "request" class="Utils.Studente" ></jsp:useBean>

<div id="Menu_background"> </div> 
<div id="Top_bar"> </div> 
<div id="Bottom_bar"> </div>

<div id="Header">

	<div id="LOGO_UNITN" class="image" style="position:absolute;left:26px;top:15px;width:339px;height:93px;z-index:0;padding:0;">
	<img src="images/logo_unitn1.gif" id="Image1" alt="" border="0" style="width:339px;height:93px;"></div>

</div>

<div id="SlideMenu1">
<ul class="nav nav-list">
  <li class="nav-header">
    segreteria
  </li>
  <li class="active">
    <a href="Studenti_Segreteria">Studenti</a>
  </li>
  <li>
    <a href="Corsi_Segreteria">Corsi</a>
  </li>
  <li>
    <a href="Logout">Logout</a>
  </li>
</ul>
</div>

<div style="position:absolute;left:190px;top:162px">
    <h3>Ricerca:</h3>

<form class="form-horizontal" name="ricerca_studente" action="Studenti_Segreteria" style="position:relative;left:-80px">
<fieldset>  
<div class="control-group">
    <label class="control-label">Nome</label>
    <div class="controls">
        <input type="text" class="input-medium"name="nome">
        <button type="submit" id="Button4" class="btn btn-primary" value="Cerca" style="position:relative;left:10px;">Cerca</button>
    </div>
    
</div>
    
<div class="control-group">
    <label class="control-label">Cognome</label>
    <div class="controls">
        <input type="text" class="input-medium"name="cognome">
    </div>
</div>
    
<div class="control-group">
    <label class="control-label">Matricola</label>
    <div class="controls">
        <input type="text" class="input-medium"name="matricola">
    </div>
</div>
    
<div class="control-group">
    <label class="control-label">Advisor</label>
    <div class="controls">
        <input type="text" class="input-medium" name="advisor">
    </div>
</div>
    
    
</fieldset>
</form> 

</div>


<div style="position:absolute;left:540px;top:162px">
    <h3>Studente selezionato</h3></div>


<div id="wb_Text4" style="position:absolute;left:190px;top:410px">
    <h4>Risultati ricerca</h4>

<!-- tabella lista studenti cercati-->

<div style="position:relative;top:12px;width:236px;height:450px;overflow:auto;">
<table id="selectable" class="table table-bordered">    
    <tr id = "Row-0">
        <th> 
            Risultato
        </th>
    </tr>

<c:forEach items="${result}" var="studente">
                        <tr id="${studente.matricola}">
                            <td style="cursor:default;" ><c:out value="${studente.nome}"/> <c:out value="${studente.cognome}"/> </td>
                        </tr>            
                    </c:forEach>    

</table>
</div>
</div>

<div style="position:absolute;left:540px;top:190px;">

    <ul class="nav nav-tabs" id="tabs">
        <li><a href="#tab1" data-toggle="tab"><h4>Dati Studente</h4></a></li>
        <li><a href="#tab2" data-toggle="tab"><h4>Primo Anno</h4></a></li>
        <li><a href="#tab3" data-toggle="tab"><h4>Secondo Anno</h4></a></li>
        <li><a href="#tab4" data-toggle="tab"><h4>Terzo Anno</h4></a></li>
    </ul> 
    
    <div class="tab-content" >
        
    <div class="tab-pane" id="tab1">
    
        <table class="table table-bordered" style="position:relative;top:10px;width: 99%; z-index:5;" cellpadding="0" cellspacing="0" id="Table1">
		<tr>
		<th colspan="4" style="width:600px;">
		Dati personali
		</th>
		</tr>
		<tr>
		<td style="width:25%">
		Matricola
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="matricola"></jsp:getProperty>
		</td>
		<td style="width:25%">
		Domicilio
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="domicilio"></jsp:getProperty>
		</td>
		</tr>
		<tr>
		<td style="width:25%">
		Nome
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="nome"></jsp:getProperty>
		</td>
		<td style="width:25%">
		Numero ufficio
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="numero_ufficio"></jsp:getProperty>
		</td>
		</tr>
		<tr>
		<td style="width:25%">
		Cognome
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="cognome"></jsp:getProperty>
		</td>
		<td style="width:25%">
		Email
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="email"></jsp:getProperty>
		</td>
		</tr>
		<tr>
		<td style="width:25%">
		Data di nascita
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="data_nascita"></jsp:getProperty>
		</td>
		<td style="width:25%">
		Sospeso
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="nome"></jsp:getProperty>
		</td>
		</tr>
		<tr>
		<td style="width:25%">
		Luogo di nascita
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="luogo_nascita"></jsp:getProperty>
		</td>
                <td style="width:25%">
                Ammesso con condizione
		</td>
                <td style="width:25%">
                <% if(studente.getMatricola().equals(""))
                        out.append("");
                   else
                    if(studente.isAmmesso_condizione()) out.append("Si"); else out.append("No"); %>
		</td>
		</tr>
                <tr>
		<td style="width:25%">
		Residenza
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="residenza"></jsp:getProperty>
		</td>
                <td style="width:25%">
                Anno di corso
		</td>
                <td style="width:25%">
                <% if(studente.getMatricola().equals(""))
                        out.append("");
                   else
                    out.append(""+studente.getAnno()); %>
		</td>
		</tr>
		<tr>
		<th colspan="4" class="table_header">
		Informazioni advisor
		</th>
		</tr>
		<tr>
		<td style="width:25%">
		Nome
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="adv_nome"></jsp:getProperty>
		</td>
		<td style="width:25%">
		Cognome
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="adv_cognome"></jsp:getProperty>
		</td>
		</tr>
		<tr>
		<td style="width:25%">
		E-mail
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="adv_email"></jsp:getProperty>
		</td>
		<td colspan="2" style="width:25%">
                    &nbsp;
		</td>
		</tr>
		<tr>
		<th colspan="4">
		Informazioni aggiuntive
		</th>
		</tr>
		<tr>
		<td style="width:25%">
		Fondi personali
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="nome"></jsp:getProperty>
		</td>
		<td style="width:25%">
		PHD scolarship
		</td>
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="nome"></jsp:getProperty>
		</td>
		</tr>
		<tr>
		<td style="width:25%">
		Numero armadio
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="nome"></jsp:getProperty>
                </td>
		<td style="width:25%">
		Scolarship type
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="nome"></jsp:getProperty>
		</td>
		</tr>
                <tr>
		<td style="width:25%">
		Has PC rights
		</td>
		<td style="width:25%"
                    <jsp:getProperty name = "studente" property="nome"></jsp:getProperty>
                </td>
		<td style="width:25%">
		PHD cycle
		</td>
		<td style="width:25%">
                    <jsp:getProperty name = "studente" property="nome"></jsp:getProperty>
		</td>
		</tr>
		</table>
          
    <button type="button" class="btn">
        Modifica
    </button>
        
    <button type="button" class="btn">
        Salva Modifiche
    </button>
        
    </div>
                
    <div class="tab-pane" id="tab2">
    
        <h4>
            Piano di studio : in approvazione / approvato / non approvato
        </h4>
	
        <h6>
            Crediti Totali 0/30<br>
            Crediti corsi interni minimi 0/18<br>
            Crediti corsi esterni 0
        </h6>
        <br>
    	<table class="table table-bordered">
		<tr>
		<th style="width:150px">
		Nome
		</th>
		<th style="width:150px">
		Periodo
		</th>
		<th style="width:150px">
		Link
		</th>
		<th style="width:150px">
		Docente
		</th>
		<th style="width:150px">
		Email
		</th>
		<th style="width:150px">
		Stato
		</th>
		</tr>
		</table>
    	
    </div>
                
    <div class="tab-pane" id="tab3">
    
    <h4>
            Piano di studio : in approvazione / approvato / non approvato
        </h4>
	
        <h6>
            Crediti Totali 0/30<br>
            Crediti corsi interni minimi 0/18<br>
            Crediti corsi esterni 0
        </h6>
        <br>
    	<table class="table table-bordered">
		<tr>
		<th style="width:150px">
		Nome
		</th>
		<th style="width:150px">
		Periodo
		</th>
		<th style="width:150px">
		Link
		</th>
		<th style="width:150px">
		Docente
		</th>
		<th style="width:150px">
		Email
		</th>
		<th style="width:150px">
		Stato
		</th>
		</tr>
		</table>
        
    </div>
    
    <div class="tab-pane" id="tab4">
    
    <h4>
            Piano di studio : in approvazione / approvato / non approvato
        </h4>
	
        <h6>
            Crediti Totali 0/30<br>
            Crediti corsi interni minimi 0/18<br>
            Crediti corsi esterni 0
        </h6>
        <br>
    	<table class="table table-bordered">
		<tr>
		<th style="width:150px">
		Nome
		</th>
		<th style="width:150px">
		Periodo
		</th>
		<th style="width:150px">
		Link
		</th>
		<th style="width:150px">
		Docente
		</th>
		<th style="width:150px">
		Email
		</th>
		<th style="width:150px">
		Stato
		</th>
		</tr>
		</table>
           
    </div>
</div>
</div>

</body>
</html>